// pages/storeManage/storeInfo/storeInfo.js
import util from '../../../utils/util'
import http from '../../../utils/http'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    id: '',
    userInfo: {},
    storeInfo: {},
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.setData({
      id: options.id
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    this.getStoreInfo()
  },

  getStoreInfo() {
    http.post('/api/store/v1/store/app/shop/info/' + this.data.id).then(res => {
      if (res.code === 200) {
        this.setData({
          storeInfo: res.data
        })
      }
    })
  }
})